package example;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
import org.jasypt.hibernate3.type.EncryptedStringType;

@org.hibernate.annotations.TypeDefs({
	@org.hibernate.annotations.TypeDef(name="EncryptedString",
			typeClass=EncryptedStringType.class,
			parameters={@Parameter(name="algorithm",value="PBEWithMD5AndDES"),@Parameter(name="password",value="123456"),@Parameter(name="keyObtentionIterations",value="1000")})
})

@Entity
public class Person {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private long id;
	
	//@Type(type="EncryptedString")
	private String name;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}	
}
